<?php 


class UserInformation extends Eloquent{


	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'user_informations';
	public $timestamps = false;
	protected $primaryKey = 'id';
	
	
	public function user(){
		return $this->belongsTo('User','id');
	}

	public function hometown(){
		return $this->belongsTo('City', 'hometown_city_id');
	}

	public function currentCity(){
		return $this->belongsTo('City', 'current_city_id');
	}

	public function workplace(){
		return $this->belongsTo('Place', 'work_place_id');
	}

	public function highschoolPlace(){
		return $this->belongsTo('Place', 'highschool_place_id');
	}

	public function collegePlace(){
		return $this->belongsTo('Place', 'college_place_id');
	}

	public function favourites(){
		return $this->belongsToMany('Favourite', 'user_information_has_favourite' , 'user_id', 'favourite_id');
	}
}
